import {createBrowserRouter,Navigate} from 'react-router-dom'
import App from '../App'
import Index from '../component/Index'
import Search from '../component/Search'
import List from '../component/List'
import Ok from '../component/Ok'

let router = createBrowserRouter([
    {
        path:'/',
        element:<App></App>,
        children:[
            {
                path:'/index',
                element:<Index></Index>,
                children:[
                    {
                        path:'/index/list',
                        element:<List></List>
                    },
                    {
                        path:'/index/ok',
                        element:<Ok></Ok>
                    },
                ]
            },
            {
                path:'/search',
                element:<Search></Search>
            },
            {
                path:'/',
                element:<Navigate to='/index'></Navigate>
            },

        ]
    }
])

export default router